]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
tests: Replace "for each" construct
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 6 Feb 2018 22:25:29 +0000 (23:25 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 21 Feb 2018 13:30:22 +0000 (14:30 +0100)
It is no longer supported by recent mozjs versions, so replace it with
a regular for loop to unbreak the tests.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/38

tests/interactive/background-size.js
tests/interactive/icons.js

index f3b780fd962fdee285ac60b2630a1a0f5c9b0a13..cb66b97005b44cee9d176a1c7e57bd261b17dd1d 100644 (file)
@@ -81,16 +81,16 @@ function test() {
         tbox = new St.BoxLayout({ style: 'spacing: 20px;' });
         vbox.add(tbox);
 
-        for each (let s in backgroundSizes)
+        for (let s of backgroundSizes)
             addTestCase(image, size, s, false);
-        for each (let s in backgroundSizes)
+        for (let s of backgroundSizes)
             addTestCase(image, size, s, true);
     }
 
     function addTestImage(image) {
         const containerSizes = [[100, 100], [200, 200], [250, 250], [100, 250], [250, 100]];
 
-        for each (let size in containerSizes)
+        for (let size of containerSizes)
             addTestLine(image, size);
     }
 
index 39ef09e6bafae0d1306bfd4b32837c3f977babd9..55afdbf2b3f888a3c69866665f50b10238a14b45 100644 (file)
@@ -48,7 +48,7 @@ function test() {
     function iconRow(icons, box_style) {
         let hb = new St.BoxLayout({ vertical: false, style: box_style });
 
-        for each (let iconName in icons) {
+        for (let iconName of icons) {
             hb.add(new St.Icon({ icon_name: iconName,
                                  icon_size: 48 }));
         }